﻿Imports BUS
Imports DTO
Public Class frmTHONGTINMATHANG


    Dim mhbus As MatHangBUS = New MatHangBUS
    Private Sub LoadDsMatHang()
        dgv_SanPham.DataSource = mhbus.LoadMH()
    End Sub


    Private Sub cbb_nhanhieu_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbb_nhanhieu.SelectedIndexChanged
        Dim masp As Integer
        masp = cbb_nhanhieu.SelectedValue
        Dim spbus As New MatHangBUS
        dgv_SanPham.DataSource = MatHangBUS.loadTheoID(masp)

    End Sub



    Private Sub btn_thoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_thoat.Click
        Me.Close()
    End Sub

    Private Sub GroupPanel1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupPanel1.Click

    End Sub
    Private Sub loadCBB()
        cbb_nhanhieu.DataSource = MatHangBUS.LayTatCaTT()
        cbb_nhanhieu.DisplayMember = "TenSP"
        cbb_nhanhieu.ValueMember = "MaSP"
    End Sub
    Private Sub frmTHONGTINMATHANG_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        loadCBB()
        LoadDsMatHang()
        'loadCBB()
    End Sub

    Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
        frmTHEMSANPHAM.Show()
        Me.Hide()
    End Sub
End Class